<?php

use phpDocumentor\Reflection\Location;

$id = $_GET['id'];
$db = new PDO('mysql:host=localhost;dbname=test', 'root', 'root');

$sql = "delete from news where  id = $id";

$res = $db -> query($sql);

if( $res )
{
   $arr['code'] = 0;
   $arr['msg'] = 'OK';
   $arr['data'] = "";

}else{
    $arr['code'] = 1;
    $arr['msg'] = '数据错误!!!';
    $arr['data'] = '';
}
    echo json_encode( $arr );  


?>